clear;clc;close all;
cum = int32(260);
x0 = 0.5;
y0 = 0.5;
load 李.mat;
num = numel(x)/2;
quo1 = idivide(cum,num);
rem1 = rem(cum,num);
xp=[];
yp=[];
for ii = 1:2:(num-rem1)*2-1
    xp = [xp linspace(x(ii),x(ii+1),quo1)];
    yp = [yp linspace(y(ii),y(ii+1),quo1)];
end
for ii = (num-rem1)*2+1:2:num*2
    xp = [xp linspace(x(ii),x(ii+1),quo1+1)];
    yp = [yp linspace(y(ii),y(ii+1),quo1+1)];
end
vx = zeros(cum,1);
vy = zeros(cum,1);
for ii = 1:cum
    vx1(ii) = xp(ii)-x0;
    vy1(ii) = yp(ii)-y0;
end

load 四.mat;
num = numel(x)/2;
quo1 = idivide(cum,num);
rem1 = rem(cum,num);
xp=[];
yp=[];
for ii = 1:2:(num-rem1)*2-1
    xp = [xp linspace(x(ii),x(ii+1),quo1)];
    yp = [yp linspace(y(ii),y(ii+1),quo1)];
end
for ii = (num-rem1)*2+1:2:num*2-1
    xp = [xp linspace(x(ii),x(ii+1),quo1+1)];
    yp = [yp linspace(y(ii),y(ii+1),quo1+1)];
end
vx2 = zeros(cum,1);
vy2 = zeros(cum,1);
for ii = 1:cum
    vx2(ii) = xp(ii)-x0;
    vy2(ii) = yp(ii)-y0;
end

k = 100;  % 粒子的速度比例因子
vx1 = k*vx1;
vy1 = k*vy1;
vx2 = k*vx2;
vy2 = k*vy2;
firework(cum,vx1,vy1,vx2,vy2)